<!DOCTYPE html>
<html class="x-admin-sm">

<head>
	<meta charset="UTF-8">
	<title>电子学会比赛管理系统</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
	<link rel="stylesheet" href="./css/font.css">
	<link rel="stylesheet" href="./css/common.css">
	<link rel="stylesheet" href="./css/xadmin.css">
	<script src="./lib/layui/layui.js" charset="utf-8"></script>
	<script type="text/javascript" src="./js/abkj/auth/api/adminzoneview.js"></script>
	<script type="text/javascript" src="./js/abkj/auth/api/userinfoview.js"></script>
	<script type="text/javascript" src="./js/abkj/ext/matchExt.js"></script>
	<script type="text/javascript" src="./js/abkj/auth/api/account.js"></script>
	<script type="text/javascript" src="./js/abkj/match/api/grade.js"></script>
	<script type="text/javascript" src="./js/abkj/match/api/zone.js"></script>
	<script type="text/javascript" src="./js/abkj/match/api/tmatch.js"/></script>
	<script type="text/javascript" src="./js/abkj/match/api/matchworkjudgment.js"/></script>

	<script type="text/javascript" src="./js/abkj/match/api/judgmentdata.js"/></script>


	<script type="text/javascript" src="./js/abkj/fun_tool.js"></script>
	<script type="text/javascript" src="./js/abkj/slAjax.js"></script>
	<script src="./lib/layui/layui.js" charset="utf-8"></script>
	<script type="text/javascript" src="./js/xadmin.js"></script>
</head>

<body>
<div class="x-nav">
            <span class="layui-breadcrumb">
                <a href="">首页</a>
                <a><cite>裁判管理</cite></a>
                <a><cite>裁判详情</cite></a>
            </span>
	<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
		<i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
	</a>
</div>
<div class="layui-fluid">
	<div class="layui-row layui-col-space15">
		<div class="layui-col-md12">
			<div class="layui-card">
				<div class="layui-card-body ">
					<!--<form class="layui-form layui-col-space5 flex" style="display: flex;">-->
						<!--<div class="layui-input-inline layui-show-xs-block flex">-->
							<!--<div class="mr5" style="width: 40px;">账号</div>-->
							<!--<input type="text" name="number" placeholder="账号" autocomplete="off" class="layui-input"></div>-->
						<!--<div class="layui-input-inline layui-show-xs-block">-->
							<!--<button class="layui-btn" lay-submit="" lay-filter="sreach">-->
								<!--<i class="layui-icon">&#xe615;</i></button>-->
						<!--</div>-->
					<!--</form>-->
				</div>
				<div class="layui-card-header">
					<!--<button class="layui-btn layui-btn-danger" onclick="delAll()">-->
						<!--<i class="layui-icon"></i>批量删除-->
					<!--</button>-->
					<button class="layui-btn"  onclick="tijiao()">
						<i class="layui-icon"></i>提交
					</button>
				</div>
				<div class="layui-card-body ">
					<table class="layui-table layui-form" id="table">
					</table>
				</div>
			</div>
		</div>
	</div>
</div>
</body>
<script src="./js/jquery.min.js"></script>
<script type="text/html" id="operating">
	<a href="javascript:;" class="layui-table-link" onclick="xadmin.open('编辑','addReferee.html?editid={{d.id}}',600,400)">编辑</a>
	<!-- <a href="javascript:;" class="layui-table-link" onclick="delete1('{{d.id}}')">删除</a> -->
</script>
<script>
function tijiao(){
	   //
		 var idstring=localStorage.zuopinid
		 idstring=idstring.split(",")
		 var table = layui.table
		 var data=table.checkStatus('table').data
		 // alert(JSON.stringify(data))
		 var idstring1=[]
		 for (i=0;i<data.length;i++){
			idstring1.push(data[i].id)
		 }
		 var querydata=[]
		 for (i=0;i<idstring.length;i++){
			 for (j=0;j<idstring1.length;j++){
				   var json={}
					 json.workId=idstring[i]
					 json.judgeId=idstring1[j]
					 querydata.push(json)
			 }
		 }
     // alert(JSON.stringify(querydata))
		 MatchWorkJudgmentSave(querydata,function(data){
              if (data==true){
								  alert("作品选择裁判成功！")
									var index = parent.layer.getFrameIndex(window.name)
									//关闭当前frame
									parent.layer.close(index)

									// 可以对父窗口进行刷新
									xadmin.father_reload()
							}
		 })

}
 function delete1(id){
	 if (confirm("是否要删除裁判明细数据?")){
		 JudgmentDatadelObj(id,function(data){
			 alert("删除成功!")
			 location.reload()

		 })
	 }
 }
	/*用户-停用*/
	function member_stop(obj, id) {
		layer.confirm('确认要停用吗？',
			function (index) {

				if ($(obj).attr('title') == '启用') {

					//发异步把用户状态进行更改
					$(obj).attr('title', '停用')
					$(obj).find('i').html('&#xe62f;')

					$(obj).parents("tr").find(".td-status").find('span').addClass('layui-btn-disabled').html('已停用')
					layer.msg('已停用!', {
						icon: 5,
						time: 1000
					})

				} else {
					$(obj).attr('title', '启用')
					$(obj).find('i').html('&#xe601;')

					$(obj).parents("tr").find(".td-status").find('span').removeClass('layui-btn-disabled').html('已启用')
					layer.msg('已启用!', {
						icon: 5,
						time: 1000
					})
				}

			})
	}

	/*用户-删除*/
	function member_del(obj, id) {
		layer.confirm('确认要删除吗？',
			function (index) {
				//发异步删除数据
				$(obj).parents("tr").remove()
				layer.msg('已删除!', {
					icon: 1,
					time: 1000
				})
			})
	}

	function delAll(argument) {
		vara = argument
		var data = tableCheck.getData()

		layer.confirm('确认要删除吗？' + data,
			function (index) {
				//捉到所有被选中的，发异步进行删除
				layer.msg('删除成功', {
					icon: 1
				})
				$(".layui-form-checked").not('.header').parents('tr').remove()
			})
	}
	function request(strParame) {
		var args = new Object( );
		var query = location.search.substring(1);

		var pairs = query.split("&"); // Break at ampersand
		for(var i = 0; i < pairs.length; i++) {
		var pos = pairs[i].indexOf('=');
		if (pos == -1) continue;
		var argname = pairs[i].substring(0,pos);
		var value = pairs[i].substring(pos+1);
		value = decodeURIComponent(value);
		args[argname] = value;
		}
		return args[strParame];
	}
	$(function () {
		layui.use(['form', 'table'], function () {
			var form = layui.form
			// layer.msg('玩命卖萌中', function(){
			//   //关闭后的操作
			//   });
			//监听提交
			form.on('submit(sreach)', function (data) {
				console.log(data)
				// layer.msg(JSON.stringify(data.field), function () {
				// location.href = 'index.html'
				// })
				return false
			})
      // alert()
			localStorage.myuserid=request("userId")
			var param = {
				eq:{
					userId:request("userId")
				}
			}
        data=JSON.parse(localStorage.selectcaipanlist)
				 // alert(JSON.stringify(data))
				var table = layui.table
				table.render({
					elem: '#table',
					height: 500,
					url: '', //数据接口
					page: true, //开启分页
					cols: [[ //表头
						{type: 'checkbox', fixed: 'left',name:"xitong"},
						{field: 'id', title: '账号id', width: 80},
						{field: 'name', title: '裁判姓名'},

						{field: 'workUnit', title: '学校'},
					]],
					data: data
				})


		})


	})
</script>

</html>
